export const formKeyDictionary = {
  register: ['userName', 'userPass', 'userRePass', 'birthday', 'email', 'mobile'] // 注册表单项
};

export const formValidateConfig = {
  register:
    [
      {
        fieldCode: 'userName',
        fieldName: '用户名',
        required: true,
        requiredMessage: '用户名不能为空',
        maxLength: 20,
        maxLengthMessage: '用户名长度不能超过20个字符',
        minLength: 6,
        minLengthMessage: '用户名长度不能小于6个字符',
        placeHolder: '请输入用户名'
      },
      {
        fieldCode: 'userPass',
        fieldName: '用户密码',
        required: true,
        requiredMessage: '用户密码不能为空',
        maxLength: 20,
        maxLengthMessage: '用户名长度不能超过20个字符',
        minLength: 10,
        minLengthMessage: '用户名长度不能小于10个字符',
      },
      {
        fieldCode: 'userRePass',
        fieldName: '密码确认',
        required: true,
        requiredMessage: '密码确认不能为空',
        equalTo: 'userPass',
        equalToMessage: '两次输入密码不一致'
      },
      {
        fieldCode: 'birthday',
        fieldName: '出生日期',
        regex: '^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$',
        regexMessage: '日期格式不正确',
        time: true,
        timeMessage: '日期格式不正确',
        placeHolder: '请输入出生日期（2017-08-09）'
      },
      {
        fieldCode: 'email',
        fieldName: '邮箱',
        regex: '^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$',
        regexMessage: '邮箱格式不正确',
        placeHolder: '请输入邮箱'
      },
      {
        fieldCode: 'mobile',
        fieldName: '手机号码',
        maxLength: 11,
        maxLengthMessage: '手机号码长度不能超过11个字符',
        minLength: 11,
        minLengthMessage: '手机号码长度不能小于11个字符',
        regex: '^1(3|4|5|7|8)\\d{9}$',
        regexMessage: '手机号码格式不正确',
      }
    ]
};
